IOMMU: add common API for device reserved memory
authorMarek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Mon, 26 Sep 2022 09:10:31 +0000 (11:10 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 26 Sep 2022 09:10:31 +0000 (11:10 +0200)
commitfaccb3a08b454201fa4e4f1d2e08282f07627166
treea867024cc00f690f11d500d2d56a0844d5de471d
parent022e40edd4dc00b9784e5e659dac7f9f92bedfa3
IOMMU: add common API for device reserved memory

Add API similar to rmrr= and ivmd= arguments, but in a common code. This
will allow drivers to register reserved memory regardless of the IOMMU
vendor.
The direct reason for this API is xhci-dbc console driver (aka xue),
that needs to use DMA. But future change may unify command line
arguments for user-supplied reserved memory, and it may be useful for
other drivers in the future too.

This commit just introduces an API, subsequent patches will plug it in
appropriate places. The reserved memory ranges needs to be saved
locally, because at the point when they are collected, Xen doesn't know
yet which IOMMU driver will be used.

Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/drivers/passthrough/iommu.c
xen/include/xen/iommu.h